package com.chennan.spring.demo.annotation.componentscan;

import com.chennan.spring.demo.annotation.configuration.ConfigurationTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author chennan
 * @create 2021-11
 */
public class Test {
    public static void main(String[] args) {
        ApplicationContext app = new AnnotationConfigApplicationContext(ComponentScanTest.class);
        String[] beanDefinitionNames = app.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName);
        }
//        Object person = app.getBean("person");
//        System.out.println(person);
    }
}
